Skip to content

Run unit tests in CI on postgres as well as sqlite #16224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks
stevejalim opened this issue Apr 28, 2025 · 1 comment
Open
2 tasks

Run unit tests in CI on postgres as well as sqlite #16224

stevejalim opened this issue Apr 28, 2025 · 1 comment
Labels
Backend Server stuff yo Help wanted 👋 Community contributions welcome Infra Infrastructure

Comments

@stevejalim
Copy link
Contributor

Description

We use both postgres and sqlite, depending on the environment/situation.

At the moment, our CI runs all tests against sqlite, but it would be good if we instead (or also) them in CI against postgres.


Success Criteria

@stevejalim stevejalim added Infra Infrastructure Backend Server stuff yo Help wanted 👋 Community contributions welcome labels Apr 28, 2025
@janbrasna
Copy link
Contributor

janbrasna commented Apr 30, 2025

@stevejalim Quickly checking status quo: CI is testing in a container with make test-image which is this env config:

DEBUG=False
DEV=False
ALLOWED_HOSTS=*
ADMINS=["thedude@example.com"]
WAGTAIL_ENABLE_ADMIN=True

A note in compose hints at the db service currently intended only for local dev:

# Standalone postgres database - for local runserver development.
# TODO: add this as a dependency of app/test/release
db:
image: postgres:15-alpine
environment:
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"

so question is whether that would be enough to stand up for GHA test use too?

I'm thinking how to best actually start off with a useful postgres state… as it at least needs running ./bin/fill-empty-postgres-database.sh that's not part of any bootstrap scripting yet.

Whether to reuse the same container, not rebuilding from scratch, not running a separate make command with separate docker build, and exposing separate env boilerplate… and just echoing the extra config and running it again now against the db service right after it? (Sounds ugly, but may conserve some resources.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Server stuff yo Help wanted 👋 Community contributions welcome Infra Infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants